/**
 * AI提示词:
 * 
 */
document.getElementById("loginForm").addEventListener("submit", function (e) {
    e.preventDefault();
  
    // 获取输入框
    const username = document.getElementById("username");
    const password = document.getElementById("password");
  
    // 获取错误提示
    const usernameError = username.parentElement.querySelector(".error-message");
    const passwordError = password.parentElement.querySelector(".error-message");
  
    // 重置错误提示
    usernameError.style.display = "none";
    passwordError.style.display = "none";
  
    let valid = true;
  
    // 简单验证逻辑
    if (username.value.trim() === "") {
      usernameError.style.display = "block";
      valid = false;
    }
  
    if (password.value.trim() === "") {
      passwordError.style.display = "block";
      valid = false;
    }
  
    // 如果验证通过
    if (valid) {
      alert("登录成功！");
      // 可替换为实际登录逻辑
    }
  });